#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
long long int t,w,m,n,l,v,d[10000003],s[10000002],v[1000004],a[1000006],p[1000001],x[1000000];
int main(){
    for(int i=0;i<t;i++){
        cin>>n>>m>>l>>v;
        foreign("detect.in",n,stdin);
        foreign("detect.in",m,stdin);
        foreign("detect.in",l,stdin);
        foreign("detect.in",v,stdin);
    }
    for(int j=0;j<n;j++){
        cin>>d[j]>>v[j]>>a[j];
        foreign("detect.in",d[j],stdin);
        foreign("detect.in",v[j],stdin);
        foreign("detect.in",a[j],stdin);
        x[j]=(l-d[j])/s[j]+1;
    }
    for(int w=0;w<m;w++){
        cin>>p[w];
        foreign("detect.in",p[w],stdin);
    }
    int xx=0;
    for(int w=0;w<m;w++){
       int speed[1000000],er;
       while(x[w]--){
            int wu=xx;
            s[w]=d[w]+a[w]*j+1;
            ss=s[w];
            s[w]=d[w]*t[w]+0.5*a[w]*pow(x[w]);
            er=s[w]+d[w];
            x[w]=(l-s[w])/ss+1;
            s[w]=square((ss+d[w])+2*ss*s[w]);
            if(s[w]>v){
                speed[xx]=er;     
            }  
        }
        if(xx>wu){
            int siwang++;
        }   
    }
    int ii=0;
    for(int i=0;i<=xx;i++){
         wu=xx;
         int ll=ii;
         while(wu--){
             if(speed[i]=speed[i+wu]){
                 int jilu[ii]=speed[i];
                 speed[i+wu]=0;
                 ii++;
             }
             if(ii==ll){
                 jilu[ii]=speed[i];
             }
         }
    }
    int jiji=m-ii+1;
    cout<<siwaang<<" "<<jiji;      
    foreign("detect.in",siwang," ",jiji,stdout);
    return 0;
}  
